﻿#include<stdio.h>
double fact(int n)
{
	double l;
	l = 1;
	for (int i = 1; i <= n;
		i++) {
		l = l * i;
	}
	return l;
}int main()
{
	int n;
	double e;
	e = 0;
	printf("请输入正整数n:");
	scanf_s("%d", &n);
	for (int i = 1;
		i <= n; i++) {
		e = fact(i) + e;
	}    printf("前n项和为%lf\n", e);
	printf("熊孝义\n");

	return 0;
}
